package chapter06.visit

object test{

  def main(args: Array[String]): Unit = {
    var clerk :Clerk=new Clerk
    clerk.name
  }
}
/*伴生对象
* 写静态的内容
* */
object Clerk {
  //伴生对象可以访问伴生类的私有属性
    def test(c:Clerk): Unit ={
      println()
      c.name
    }
}

/*
*伴生类
*写非静态内容
* */
class Clerk {
  private [visit] var name: String = _

}